package com.fig4ever.test.awt;

import java.awt.*;
import java.awt.event.*;

public class TfTestMulti {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new MyFrame().lanuchFrame();

	}

}

class MyFrame extends Frame{
	public TextField num1,num2,result;
	public void lanuchFrame(){
		num1 = new TextField(30);
		num2 = new TextField(30);
		result = new TextField(30);
		Label l = new Label("*");
		Button b = new Button("=");
		b.addActionListener(new MyListener(this));
		this.setLayout(new FlowLayout());
		this.add(num1);
		this.add(l);
		this.add(num2);
		this.add(b);
		this.add(result);
		this.pack();
		this.setVisible(true);
	}
}

class MyListener implements ActionListener{
	
	MyFrame m;
	MyListener(MyFrame m){
		this.m = m;
	}
	
	public void actionPerformed(ActionEvent e){
		String s1 = m.num1.getText();
		String s2 = m.num2.getText();
		int i1 = Integer.parseInt(s1);
		int i2 = Integer.parseInt(s2);
		m.result.setText(""+(i1*i2));
	}
	
}